package day4;

public class Test2Integer {
    public static void main(String[] args) {
        int a = 10;
        int b = 10;
        System.out.println("a==b:"+(a==b));

        Integer a1 = 10;
        Integer b1 = 10;
        System.out.println("a1的地址："+System.identityHashCode(a1));
        System.out.println("a2的地址："+System.identityHashCode(b1));
        System.out.println("a1==b1:"+(a1==b1));

//-128~127
        Integer a3 = 128;
        Integer b3 = 128;
        System.out.println("a3==b3:"+(a3==b3));//false

       /* Integer a2 = new Integer(10);
        Integer b2 = new Integer(10);
        System.out.println(a2);
        System.out.println(b2);
        System.out.println("a2==b2"+(a2==b2));
*/
        //给变量
        int num = 127;
        Integer a4 = num;
        Integer b4 = num;
        System.out.println("a4==b4:"+(a4==b4));
    }
}
